package com.csun.dsms.controller;


import cn.hutool.http.HttpUtil;
import com.csun.dsms.comment.core.utils.wrapper.WrapMapper;
import com.csun.dsms.comment.core.utils.wrapper.Wrapper;
import com.csun.dsms.model.dto.gaode.GaodeDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;


@Slf4j
@RestController
@RequestMapping("/gaode")
public class GaodeController {


    @PostMapping(value = "/queryAddress")
    public Wrapper queryListWithPage(@RequestBody GaodeDto gaodeDto) {
        HashMap<String, Object> paramMap = new HashMap<>();
        paramMap.put("key", gaodeDto.getKey());
        paramMap.put("location", gaodeDto.getLocation());
        paramMap.put("radius", gaodeDto.getRadius());
        String result3 = HttpUtil.get("https://www.baidu.com", paramMap);

        return WrapMapper.wrap(Wrapper.SUCCESS_CODE, result3);
    }

}
